package com.mapper;

import com.pojo.Cclass;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

/**
* @author 27761
* @description 针对表【cclass】的数据库操作Mapper
* @createDate 2024-11-19 18:52:22
* @Entity com.pojo.Cclass
*/
public interface CclassMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Cclass record);

    int insertSelective(Cclass record);

    Cclass selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Cclass record);

    int updateByPrimaryKey(Cclass record);

    @Select("select * from cclass where id=#{id}")
    @Results({
            @Result(id=true,column = "id",property = "id"),
            @Result(column = "classname",property = "classname"),
            @Result(column = "id",property ="sstudent",
            many = @Many(select = "com.mapper.SstudentMapper.selectSstudentByCclassId"))})
    Cclass selectByCclassId(int id);
}
